package com.ethank.system.enums;

/**
 * @author Administrator
 */
public enum BillEnum {
    MIXED_INVOICES(1, "HTBill", "混贴发票"),
    HOTEL_CONSUME(2, "hotelConsume", "酒店流水"),
    PAYMENT_RECORD(3, "paymentRecord", "支付详情"),
    INVOICE(4, "recognizeInvoice", "增值税发票"),
    QUOTA_INVOICE(5, "quotaInvoice", "定额发票"),
    AIR_ITINERARY(6, "airItinerary", "航空行程单"),
    TRAIN_INVOICE(7, "trainInvoice", "火车票"),
    TAXI_INVOICE(8, "taxiInvoice", "出租车发票"),
    ROLL_TICKET(9, "rollTicket", "增值税发票卷票"),
    BUS_SHIP_TICKET(10, "busShipTicket", "客运车船票"),
    COMMON_PRINTED_INVOICE(11, "commonPrintedInvoice", "通用机打发票"),
    RIDE_HAILING_ITINERARY(12, "rideHailingItinerary", "网约车行程单"),
    TOLL_INVOICE(13, "tollInvoice", "过路过桥费发票");

    private Integer type;
    private String invokeName;
    private String billTypeName;


    BillEnum(Integer type, String invokeName, String billTypeName) {
        this.type = type;
        this.invokeName = invokeName;
        this.billTypeName = billTypeName;
    }

    BillEnum() {
    }

    public static Integer getTypeByBillTypeName(String byn) {
        if (byn == null || byn.isEmpty()) {
            return null;
        }
        for (BillEnum value : BillEnum.values()) {
            if (value.billTypeName.equals(byn)) {
                return value.type;
            }
        }
        return null;
    }

    /**
     * @param type
     * @return
     * @desc 根据类型查询相应的方法
     */
    public static String getInvokeName(Integer type) {
        String invokeName = "";
        if (null == type) {
            return invokeName;
        }
        for (BillEnum billEnum : BillEnum.values()) {
            if (billEnum.getType().equals(type)) {
                return billEnum.getInvokeName();
            }
        }

        return invokeName;
    }


    public String getBillTypeName() {
        return billTypeName;
    }

    public void setBillTypeName(String billTypeName) {
        this.billTypeName = billTypeName;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getInvokeName() {
        return invokeName;
    }

    public void setInvokeName(String invokeName) {
        this.invokeName = invokeName;
    }
}
